#!/bin/sh

# 执行数据库迁移
python manage.py makemigrations
python manage.py migrate

if [ $? -ne 0 ];then
  echo '数据库连接失败重启'
  exit 1
fi

# 创建用户/角色/权限
# echo "from create_super_user import permissions, create_permissions, create_role, create_super_user; create_super_user();" | python manage.py shell > /dev/null

supervisord -c supervisord.conf